<script>
/**
 * 权限校验的组件
 * 函数式组件
 */
import { check } from "@/utils/auth";
export default {
  functional: true,
  name: "Authorized",
  props: {
    authority: {
      type: Array,
      required: true,
    },
  },
  render: function (createElement, context) {
    const { props, scopedSlots } = context;
    return check(props.authority) ? scopedSlots.default() : null;
  },
};
</script>

<style></style>
